#ifndef THREAD_H
#define THREAD_H

#include <pthread.h>

namespace gti {

class Thread;

typedef struct
{
	void* data;
	Thread* thread;
} tThreadData;

class Thread
{
	enum { STOPPED = 0, RUNNING, FINNISHED };

	pthread_t thread_info;
	pthread_mutex_t global_mutex;
	char state;

public:
	typedef void* (*function_callback)(void*);


	Thread();

	void execute( function_callback f, void* data );

	void lock();
	void unlock();

	void kill();

protected:
	tThreadData data;

	//static void Thread::keepThreads();
};

};

#endif